package top.hcode.hoj.pojo.entity.course;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import top.hcode.hoj.pojo.entity.problem.Tag;
import top.hcode.hoj.pojo.entity.user.UserInfo;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author orangej
 * @since 2024/12/17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "习题", description = "")
public class Question implements Serializable {

    private static final long serialVersionUID = 7813949308342977812L;

    @ApiModelProperty(value = "习题id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "习题描述")
    private String content;

    @ApiModelProperty(value = "习题类型：1：单选题，2：多选题，3：填空题，9：编程题")
    private Integer type;

    @ApiModelProperty(value = "习题答案，大写英文字母，例如：A, B, C，多选题：AB")
    private String answer;

    @ApiModelProperty(value = "习题解析")
    private String solution;

    @ApiModelProperty(value = "是否公开，0不公开，1公开")
    private Boolean isPublic;

    @ApiModelProperty(value = "是否有子题")
    private Boolean hasChildren;

    @ApiModelProperty(value = "主习题id")
    private Long parentId;

    @TableField(fill = FieldFill.INSERT)
    private Date gmtCreate;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date gmtModified;


    /* 关联字段 */
    @TableField(exist = false)
    private Course course;

    @TableField(exist = false)
    private List<QuestionOption> options;

    @TableField(exist = false)
    private List<Question> children;

    @TableField(exist = false)
    private List<Tag> tags;

}
